// 用户类型定义
export interface User {
  id: number;
  login: string;
  name: string;
  avatar_url: string;
  url: string;
  html_url: string;
  remark: string;
  followers_url: string;
  following_url: string;
  gists_url: string;
  starred_url: string;
  subscriptions_url: string;
  organizations_url: string;
  repos_url: string;
  events_url: string;
  received_events_url: string;
  type: string;
  blog: string | null;
  weibo: string | null;
  bio: string | null;
  public_repos: number;
  public_gists: number;
  followers: number;
  following: number;
  stared: number;
  watched: number;
  created_at: string;
  updated_at: string;
  email: string | null;
  accessToken: string;
  refreshToken?: string;
  tokenExpiresAt?: number;
}

// 仓库类型定义
export interface Repository {
  id: number;
  name: string;
  fullName: string;
  description: string;
  htmlUrl: string;
  sshUrl: string;
  cloneUrl: string;
  defaultBranch: string;
  isPrivate: boolean;
  fork: boolean;
  stargazersCount: number;
  watchersCount: number;
  forksCount: number;
  openIssuesCount: number;
  createdAt: string;
  updatedAt: string;
  pushedAt: string;
  ownerId: number;
}

// 仓库文件类型定义
export interface RepositoryFile {
  name: string;
  path: string;
  sha: string;
  size: number;
  url: string;
  htmlUrl: string;
  gitUrl: string;
  downloadUrl: string;
  type: 'file' | 'dir' | 'symlink';
  content?: string;
  encoding?: string;
}

// 提交类型定义
export interface Commit {
  sha: string;
  message: string;
  author: {
    name: string;
    email: string;
    date: string;
  };
  committer: {
    name: string;
    email: string;
    date: string;
  };
  date: string;
  url: string;
  htmlUrl: string;
}

// API响应类型定义
export interface ApiResponse<T> {
  data: T;
  status: number;
  statusText: string;
  headers: Record<string, string>;
}

// 错误类型定义
export interface ApiError {
  message: string;
  status: number;
  statusText: string;
}